const request = require("request"); //发送ajax请求

const fs = require("fs"); //核心模块
let path = require("path"); //处理路径的模块，核心模块
let url = "http://img01.hua.com/uploadpic/newpic/9012474.jpg_220x240.jpg";

let filename = path.basename(url); //获取路径后面的文件名
console.log(filename);

request(url).pipe(fs.createWriteStream("./img/" + filename));
